//
//  Person.m
//  OC3_继承
//
//  Created by dllo on 15/10/26.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Person.h"

@implementation Person

+ (id)personWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age
{
    Person *p = [[Person alloc] initWithName:name sex:sex age:age];
    return p;
}


- (NSString *)name
{
    return _name;
}

- (void)setName:(NSString *)name
{
    _name = name;
}
- (NSString *)sex
{
    return _sex;
}
- (void)setSex:(NSString *)sex
{
    _sex = sex;
}
- (NSInteger)age
{
    return _age;
}
- (void)setAge:(NSInteger)age
{
    _age = age;
}

- (id)initWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age
{
    self = [super init];
    
    if (self) {
        _name = name;
        _sex = sex;
        _age = age;
    }
    return self;
}

- (void)info
{
    NSLog(@"%@ %@ %ld", _name, _sex, _age);
}



@end
